package com.scpii.universal.pns.entity;

import java.util.Date;
import java.util.List;

import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang.StringUtils;

import com.scpii.universal.pns.dto.FieldImageDto;
import com.scpii.universal.pns.dto.UserRegFieldDto;

/**
 * Field entity. @author MyEclipse Persistence Tools
 */

public class Field implements java.io.Serializable {

	// Fields

	private static final long serialVersionUID = -1843181887162190648L;
	private Long id;
	private Long categoriesId;
	private String name;
	private String aliasName;
	private String mask;
	private Long appId;
	private Date createDt;
	private Long createBy;
	private Date updateDt;
	private Long updateBy;
	private String metaType;

	private String typeName;

	private String fieldValue;

	private UserRegFieldDto userRegFieldDto;
	private List<FieldImageDto> fieldImageList;
	private short status;

	// Constructors

	/** default constructor */
	public Field() {
	}

	public Field(String aliasName, String fieldValue) {
		super();
		this.aliasName = aliasName;
		this.fieldValue = fieldValue;
	}

	/** minimal constructor */
	public Field(Long categoriesId, String name, Long appId) {
		this.categoriesId = categoriesId;
		this.name = name;
		this.appId = appId;
	}

	/** full constructor */
	public Field(Long categoriesId, String name, String aliasName, String mask,
			Long appId, Date createDt, Long createBy, Date updateDt,
			Long updateBy, String metaType) {
		this.categoriesId = categoriesId;
		this.name = name;
		this.aliasName = aliasName;
		this.mask = mask;
		this.appId = appId;
		this.createDt = createDt;
		this.createBy = createBy;
		this.updateDt = updateDt;
		this.updateBy = updateBy;
		this.metaType = metaType;
	}

	// Property accessors

	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getCategoriesId() {
		return this.categoriesId;
	}

	public void setCategoriesId(Long categoriesId) {
		this.categoriesId = categoriesId;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getAliasName() {
		return this.aliasName;
	}

	public void setAliasName(String aliasName) {
		this.aliasName = aliasName;
	}

	public String getMask() {
		return this.mask;
	}

	public void setMask(String mask) {
		this.mask = mask;
	}

	public Long getAppId() {
		return this.appId;
	}

	public void setAppId(Long appId) {
		this.appId = appId;
	}

	public Date getCreateDt() {
		return this.createDt;
	}

	public void setCreateDt(Date createDt) {
		this.createDt = createDt;
	}

	public Long getCreateBy() {
		return this.createBy;
	}

	public void setCreateBy(Long createBy) {
		this.createBy = createBy;
	}

	public Date getUpdateDt() {
		return this.updateDt;
	}

	public void setUpdateDt(Date updateDt) {
		this.updateDt = updateDt;
	}

	public Long getUpdateBy() {
		return this.updateBy;
	}

	public void setUpdateBy(Long updateBy) {
		this.updateBy = updateBy;
	}

	public String getMetaType() {
		return this.metaType;
	}

	public void setMetaType(String metaType) {
		this.metaType = metaType;
	}

	public UserRegFieldDto getUserRegFieldDto() {
		return userRegFieldDto;
	}

	public void setUserRegFieldDto(UserRegFieldDto userRegFieldDto) {
		this.userRegFieldDto = userRegFieldDto;
	}

	public List<FieldImageDto> getFieldImageList() {
		return fieldImageList;
	}

	public void setFieldImageList(List<FieldImageDto> fieldImageList) {
		this.fieldImageList = fieldImageList;
	}

	public String getTypeName() {
		return typeName;
	}

	public void setTypeName(String typeName) {
		this.typeName = typeName;
	}

	public String getFieldValue() {
		return fieldValue;
	}

	public void setFieldValue(String fieldValue) {
		this.fieldValue = fieldValue;
	}

	public short getStatus() {
		return status;
	}

	public void setStatus(short status) {
		this.status = status;
	}

	public Boolean getIsSysField() {
		if (ArrayUtils.contains(Users.COLUMNS, name)) {
			return true;
		} else {
			return false;
		}
	}
}